import { Image, Tooltip } from 'antd'
export const column = [
  {
    title: '序号',
    width: 70,
    render: (_, __, index) => `${index + 1}`,
    align: 'center'
  },
  {
    width: 80,
    title: '区',
    dataIndex: 'county_name',
    key: 'county_name',
    align: 'center'
  },
  {
    title: '行业',
    dataIndex: 'industry_type',
    key: 'industry_type',
    align: 'center',
    width: 150
  },
  {
    width: 160,
    title: '企业名称',
    dataIndex: 'ent_name',
    key: 'ent_name',
    align: 'center',
    ellipsis: {
      showTitle: false
    },
    render: (text) => {
      return (
        <Tooltip placement="topLeft" title={text}>
          {text}
        </Tooltip>
      )
    }
  },
  {
    title: '区域/位置',
    dataIndex: 'area',
    key: 'area',
    align: 'center',
    width: 100
  },
  {
    title: '管控对象',
    dataIndex: 'mornitoring_facility',
    key: 'mornitoring_facility',
    align: 'center',
    width: 100
  },
  {
    title: '监测对象',
    dataIndex: 'monitoring_object',
    key: 'monitoring_object',
    align: 'center',
    ellipsis: {
      showTitle: false
    },
    width: 150,
    render: (text) => {
      return (
        <Tooltip placement="topLeft" title={text}>
          {text}
        </Tooltip>
      )
    }
  },
  {
    title: '安装位置',
    dataIndex: 'installation_location',
    key: 'installation_location',
    align: 'center',
    width: 150
  },
  {
    title: '安装方式',
    dataIndex: 'installation_method',
    key: 'installation_method',
    align: 'center',
    width: 100
  },
  {
    title: '点位类型',
    dataIndex: 'dev_type_name',
    key: 'dev_type_name',
    align: 'center',
    width: 100
  },
  {
    title: '设备编号',
    dataIndex: 'dev_code',
    key: 'dev_code',
    align: 'center',
    ellipsis: {
      showTitle: false
    },
    width: 100,
    render: (text) => {
      return (
        <Tooltip placement="topLeft" title={text}>
          {text}
        </Tooltip>
      )
    }
  },
  {
    title: '设备入网日期',
    dataIndex: 'created_at',
    key: 'created_at',
    align: 'center',
    width: 100
  },
  // {
  //   title: '安装对象照片',
  //   dataIndex: 'monitoring_object_img',
  //   key: 'monitoring_object_img',
  //   align: 'center',
  //   type: 'image',
  //   width: 120,
  //   render: (value, row, index) => {
  //     return (
  //       <span>
  //         <Image.PreviewGroup items={value}>
  //           <Image width="100%" height={80} src={value[0]} />
  //         </Image.PreviewGroup>
  //       </span>
  //     )
  //   }
  // },
  // {
  //   title: '安装位置照片',
  //   dataIndex: 'installation_location_img',
  //   key: 'installation_location_img',
  //   align: 'center',
  //   type: 'image',
  //   width: 120,
  //   render: (value, row, index) => {
  //     return (
  //       <span>
  //         <Image.PreviewGroup items={value}>
  //           <Image width="100%" height={80} src={value[0]} />
  //         </Image.PreviewGroup>
  //       </span>
  //     )
  //   }
  // }
]
export const defaultColumn = [
  {
    title: '序号',
    width: 70,
    render: (_, __, index) => `${index + 1}`,
    align: 'center'
  },
  {
    width: 80,
    title: '区',
    dataIndex: 'county_name',
    key: 'county_name',
    align: 'center'
  },
  {
    title: '行业',
    dataIndex: 'industry_type',
    key: 'industry_type',
    align: 'center',
    width: 200
  },
  {
    width: 160,
    title: '企业名称',
    dataIndex: 'ent_name',
    key: 'ent_name',
    align: 'center',
    ellipsis: {
      showTitle: false
    },
    render: (text) => {
      return (
        <Tooltip placement="topLeft" title={text}>
          {text}
        </Tooltip>
      )
    }
  },
  {
    title: '区域/位置',
    dataIndex: 'area',
    key: 'area',
    align: 'center',
    width: 100
  },
  {
    title: '管控对象',
    dataIndex: 'mornitoring_facility',
    key: 'mornitoring_facility',
    align: 'center',
    width: 100
  },
  {
    title: '监测对象',
    dataIndex: 'monitoring_object',
    key: 'monitoring_object',
    align: 'center',
    ellipsis: {
      showTitle: false
    },
    width: 150,
    render: (text) => {
      return (
        <Tooltip placement="topLeft" title={text}>
          {text}
        </Tooltip>
      )
    }
  },
  {
    title: '设施编号',
    dataIndex: 'code_in_ent',
    key: 'code_in_ent',
    align: 'center',
    width: 100
  },
  {
    title: '安装位置',
    dataIndex: 'installation_location',
    key: 'installation_location',
    align: 'center',
    width: 150
  },
  {
    title: '安装方式',
    dataIndex: 'installation_method',
    key: 'installation_method',
    align: 'center',
    width: 100
  },
  {
    title: '点位属性',
    dataIndex: 'point_attribute',
    key: 'point_attribute',
    align: 'center',
    width: 100
  },
  {
    title: '点位类型',
    dataIndex: 'dev_type_name',
    key: 'dev_type_name',
    align: 'center',
    width: 100
  },
  {
    title: '数据来源',
    dataIndex: 'who_construct',
    key: 'who_construct',
    align: 'center',
    width: 100
  },
  {
    title: '设备编号',
    dataIndex: 'dev_code',
    key: 'dev_code',
    align: 'center',
    ellipsis: {
      showTitle: false
    },
    width: 100,
    render: (text) => {
      return (
        <Tooltip placement="topLeft" title={text}>
          {text}
        </Tooltip>
      )
    }
  },
  {
    title: '断路器（A）',
    dataIndex: 'circuit_breaker',
    key: 'circuit_breaker',
    align: 'center',
    width: 100
  },
  {
    title: '安装设备型号',
    dataIndex: 'equipment_model',
    key: 'equipment_model',
    align: 'center',
    width: 150
  },
  {
    title: '设备入网日期',
    dataIndex: 'created_at',
    key: 'created_at',
    align: 'center',
    width: 150
  },
  {
    title: '设备阈值一',
    dataIndex: 'rule_one_power',
    key: 'rule_one_power',
    align: 'center',
    width: 100
    // editable: true
  },
  {
    title: '设备阈值二',
    dataIndex: 'rule_two_power',
    key: 'rule_two_power',
    align: 'center',
    width: 100
    // editable: true
  },
  {
    title: '安装对象照片',
    dataIndex: 'monitoring_object_img',
    key: 'monitoring_object_img',
    align: 'center',
    type: 'image',
    width: 120,
    render: (value, row, index) => {
      return (
        <span>
          <Image.PreviewGroup items={value}>
            <Image width="100%" height={80} src={value[0]} />
          </Image.PreviewGroup>
        </span>
      )
    }
  },
  {
    title: '安装位置照片',
    dataIndex: 'installation_location_img',
    key: 'installation_location_img',
    align: 'center',
    type: 'image',
    width: 120,
    render: (value, row, index) => {
      return (
        <span>
          <Image.PreviewGroup items={value}>
            <Image width="100%" height={80} src={value[0]} />
          </Image.PreviewGroup>
        </span>
      )
    }
  }
]
